home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / cfguucp.thor < prev    next >
Text File  |  1998-05-24  |  3KB  |  85 lines

  1. /* $VER: CfgUUCP.thor 0.6 (7.11.16)
  2.  *
  3.  * External configuration for the UUCP bbstype.
  4.  *
  5.  *  Script by: Kjell Irgens, Ultima Thule Software.
  6.  */
  7.  
  8. parse arg argument
  9. options results
  10.  
  11. template = 'BBSNAME,CONFNAME/K,PUBSCREEN/K'
  12.  
  13. p=address()||' '||show('P',,);if pos('THOR.',p)>0 then thorport=word(,
  14. substr(p,pos('THOR.',p)),1);else do;say 'No THOR port found!';exit 10;end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.         "WaitForPort BBSREAD"
  20. end
  21.  
  22. address "BBSREAD"
  23.  
  24. READARGS template ARGS CMDLINE argument
  25. if rc ~= 0 then exit
  26.  
  27. GETBBSDATA bbsname '"'ARGS.BBSNAME'"' stem BBSDATA
  28. if rc ~= 0 then do
  29.     address(thorport)
  30.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  31.     exit 5
  32. end
  33.  
  34. address(thorport)
  35.  
  36. REQUESTNOTIFY TEXT '"Change configuration or headers?"' BT '"C_onfig|_Headers|_Cancel"'
  37.  
  38. if result = 1 then do
  39.     if ~open(file, BBSDATA.BBSPATH||"UUCPExtConfig", 'W') then do
  40.           address(thorport)
  41.         REQUESTNOTIFY '"Could not create config file."' '"_Ok"'
  42.         exit 0
  43.     end
  44.     call writeln(file, "4")
  45.  
  46.     REQUESTNOTIFY TEXT '"Use THOR as news reader\nor mail reader only?"' BT '"_News & Mail|_Mail only"'
  47.     if result = 1 then do
  48.         if(exists("uunews:")) then newsdir = "UUNews:"
  49.         else newsdir = ""
  50.         REQUESTFILE TITLE '"Select news directory:"' ID '"'newsdir'"' FP PAT '"~#?"'
  51.         call writeln(file, result)
  52.         REQUESTNOTIFY TEXT '"Should THOR use a From: line in postings?\nIf not, remember to add -f/-R arguments to\nthe postnews command"' BT '"_Yes|_No"'
  53.         if result = 1 then call writeln(file, "News_From")
  54.         else writeln(file, "")
  55.         REQUESTSTRING TITLE '"News posting command? (e.g. postnews)"' BT '"_Ok"' MAXCHARS 60
  56.         if(rc ~= 0) then call writeln(file, "postnews")
  57.         else call writeln(file, result)
  58.     end
  59.     else do
  60.         call writeln(file, "")
  61.         call writeln(file, "")
  62.         call writeln(file, "")
  63.     end
  64.     REQUESTNOTIFY TEXT '"Should THOR use a From: line in your mails?\nIf not, remember to add -f/-r arguments to\nthe sendmail command"' BT '"_Yes|_No"'
  65.     if result = 1 then call writeln(file, "Mail_From")
  66.     else writeln(file, "")
  67.     REQUESTSTRING TITLE '"Mail sending command? (e.g. sendmail)"' BT '"_Ok"' MAXCHARS 60
  68.     if(rc ~= 0) then call writeln(file, "sendmail")
  69.     else call writeln(file, result)
  70.     REQUESTNOTIFY TEXT '"Should THOR generate Message-Id headers?"' BT '"_Yes|_No"'
  71.     if result = 1 then call writeln(file, "Message-Id")
  72.     else writeln(file, "")
  73.     REQUESTNOTIFY TEXT '"Should THOR generate Date headers?"' BT '"_Yes|_No"'
  74.     if result = 1 then call writeln(file, "Date")
  75.     else writeln(file, "")
  76.     exit 0
  77. end
  78. if result = 2 then do
  79.     REQUESTNOTIFY TEXT '"You may create extra header lines to appear\nin the editor when you write messages.\nFollowup-To: and Keywords: are good examples."' BT '"_Edit|_Delete|_Cancel"'
  80.     if result = 1 then do
  81.         STARTEDITOR FILE BBSDATA.BBSPATH||".header"
  82.     end
  83.     if result = 2 then address command "delete >NIL: "||BBSDATA.BBSPATH||".header"
  84. end
  85.